package net.mcreator.infinite_storage;

import net.minecraftforge.common.config.Configuration;

import java.io.File;

public class InfiniteStorage {
    public Configuration config;

    public boolean bagState;

    public int needLevel;
    
    public int guiModel;

    public void init(File configFile) {
        if (config == null) {
            config = new Configuration(configFile);
            syncConfig();
        }
    }

    public void syncConfig() {
    	String bagStateText = (net.minecraft.client.resources.I18n.format("cfg.bag.state"));
    	bagState = config.getBoolean("bagState", Configuration.CATEGORY_GENERAL, true, bagStateText);

		String needLevelText = (net.minecraft.client.resources.I18n.format("cfg.bag.levels"));
    	needLevel = config.getInt("needLevel", Configuration.CATEGORY_GENERAL, 3, 1, 114514, needLevelText);

    	String guiModelText = (net.minecraft.client.resources.I18n.format("cfg.bag.gui_model"));
    	guiModel = config.getInt("guiModel", Configuration.CATEGORY_GENERAL, 1, 1, 5, guiModelText);

        if (config.hasChanged()) {
            config.save();
        }
    }
}